<template>
  <div>
    <button @click="add">+</button>
    <span>{{ count }}</span>
    <button @click="minus">-</button>
  </div>
</template>

<script>
//组件的使用:定义、注册、使用
export default {
  name: "MyCount",
  data() {
    return { count: 1 };
  },
  methods: {
    add() {
      this.count++;
    },
    minus() {
      this.count--;
    },
  },
};
</script>

<style>
</style>
